package com.gr.experimental.model.impl.distr.operations;

import com.gr.experimental.model.impl.distr.operators.OperatorFactory;

public class OperationFactory {

	final private static LiteralExpression trueExp = new LiteralExpression(true);
	final private static LiteralExpression falseExp = new LiteralExpression(false);

	public static BinaryOperation createLogicalOrExpression(Boolean b1, Boolean b2) {
		return new BinaryOperation(
				createLogicalLiteralExpression(b1),
				createLogicalLiteralExpression(b2),
				OperatorFactory.logicalOrOperator()
				);
	}

	public static BinaryOperation createLogicalAndExpression(boolean b1,
			boolean b2) {
		return new BinaryOperation(
				createLogicalLiteralExpression(b1),
				createLogicalLiteralExpression(b2),
				OperatorFactory.logicalAndOperator()
				);
	}

	public static LiteralExpression createLogicalLiteralExpression(Boolean b) {
		if (b) {
			return trueExp;
		} else {
			return falseExp;
		}
	}

}
